#include<iostream>
#include<cstring>
#include"interact.hpp"
#include"DissString.hpp"
#include"execute.hpp"
using namespace std;

#define ARGC_MAX 64
#define SIZE_MAX 1024


int main()
{
    char CommendLine[SIZE_MAX];
    char* argv[ARGC_MAX];
    int argc = 0;
    while (true)
    {
        //打印命令行, 交互
        memset(CommendLine, 0, sizeof(CommendLine));
        Commend_Line_Print(CommendLine, sizeof(CommendLine));
        CommendLine[strlen(CommendLine) - 1] = 0;
        
        //分割字符串
        memset(argv, 0, sizeof(argv));   
        argc = DissString(argv, CommendLine);
        for (int i = 0; argv[i] != nullptr; i++) cout << argv[i] << " " ;
        //普通命令执行
        execute(argv, argc);

    }



    return 0;
}